package com.authManager.commons.feignApi;

import com.authManager.commons.feignApi.hystric.SysMenuApiHystric;
import com.authManager.entity.SysMenu;
import com.commons.base.model.AdminPage;
import com.commons.base.model.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "authManager-server", fallback = SysMenuApiHystric.class)
public interface SysMenuApi {
	static final String projectAaaApiBaseUrl = "/authManager-server/admin/sysMenu";

	/**
	 * 添加【菜单信息】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/saveSysMenu", method = { RequestMethod.POST })
	public ResultData<Object> saveSysMenu(@RequestParam(value = "name",required = false) String name,
			@RequestParam(value = "systemCode",required = false) String systemCode, @RequestParam(value = "pageUrl",required = false) String pageUrl,
			@RequestParam(value = "pageUrlType",required = false) String pageUrlType, @RequestParam(value = "parentId",required = false) Long parentId,
			@RequestParam(value = "site",required = false) String site, @RequestParam(value = "sortNum",required = false) Integer sortNum,
			@RequestParam(value = "icon",required = false) String icon, @RequestParam(value = "menuType",required = false) Integer menuType,
			@RequestParam(value = "description",required = false) String description, @RequestParam(value = "buttonMark",required = false) String buttonMark,
			@RequestParam(value = "field1",required = false) String field1, @RequestParam(value = "field2",required = false) String field2,
			@RequestParam(value = "field3",required = false) String field3);

	/**
	 * 修改【菜单信息】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/editSysMenu", method = { RequestMethod.POST })
	public ResultData<Object> editSysMenu(@RequestParam(value = "sysMenuId",required = true) Long sysMenuId,
			@RequestParam(value = "name",required = false) String name, @RequestParam(value = "systemCode",required = false) String systemCode,
			@RequestParam(value = "pageUrl",required = false) String pageUrl, @RequestParam(value = "pageUrlType",required = false) String pageUrlType,
			@RequestParam(value = "parentId",required = false) Long parentId, @RequestParam(value = "site",required = false) String site,
			@RequestParam(value = "sortNum",required = false) Integer sortNum, @RequestParam(value = "icon",required = false) String icon,
			@RequestParam(value = "menuType",required = false) Integer menuType, @RequestParam(value = "description",required = false) String description,
			@RequestParam(value = "buttonMark",required = false) String buttonMark, @RequestParam(value = "field1",required = false) String field1,
			@RequestParam(value = "field2",required = false) String field2, @RequestParam(value = "field3",required = false) String field3);

	/**
	 * 删除【菜单信息】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/delSysMenu", method = { RequestMethod.POST })
	public ResultData<Object> delSysMenu(@RequestParam(value = "sysMenuId",required = true) Long sysMenuId);

	/**
	 * 获取【菜单信息】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/getSysMenu", method = { RequestMethod.POST })
	public ResultData<SysMenu> getSysMenu(@RequestParam(value = "sysMenuId",required = true) Long sysMenuId);

	@RequestMapping(value = projectAaaApiBaseUrl + "/getSysMenuBySystemCode", method = { RequestMethod.POST })
	public ResultData<SysMenu> getSysMenuBySystemCode(@RequestParam(value = "systemCode",required = true) String systemCode);

	/**
	 * 列表【菜单信息】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/listSysMenu", method = { RequestMethod.POST })
	public ResultData<AdminPage<SysMenu>> listSysMenu(
			@RequestParam(value = "pageNum",defaultValue = "1", required = false) Integer pageNum,
			@RequestParam(value = "pageSize",defaultValue = "10", required = false) Integer pageSize,
			@RequestParam(value = "sysMenuId",required = false) Long sysMenuId, @RequestParam(value = "name",required = false) String name,
			@RequestParam(value = "systemCode",required = false) String systemCode, @RequestParam(value = "pageUrl",required = false) String pageUrl,
			@RequestParam(value = "pageUrlType",required = false) String pageUrlType, @RequestParam(value = "parentId",required = false) Long parentId,
			@RequestParam(value = "site",required = false) String site, @RequestParam(value = "sortNum",required = false) Integer sortNum,
			@RequestParam(value = "icon",required = false) String icon, @RequestParam(value = "menuType",required = false) Integer menuType,
			@RequestParam(value = "description",required = false) String description, @RequestParam(value = "buttonMark",required = false) String buttonMark,
			@RequestParam(value = "field1",required = false) String field1, @RequestParam(value = "field2",required = false) String field2,
			@RequestParam(value = "field3",required = false) String field3, @RequestParam(value = "start_createTime",required = false) String start_createTime,
			@RequestParam(value = "end_createTime",required = false) String end_createTime);

	/**
	 * 根据用户id查询 某个系统所拥有的全部菜单
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/listSysMenuByRoleAndUserId", method = { RequestMethod.POST })
	public ResultData<List<SysMenu>> listSysMenuByRoleAndUserId(@RequestParam(value = "sysUserId",required = true) String sysUserId,
			@RequestParam(value = "systemCode",required = true) String systemCode,@RequestParam(value = "menuSite",required = false) String menuSite);
}
